package com.hr.mes.exception;

import com.hr.mes.enums.MyExceptionEnum;

public class MyException extends RuntimeException {

    private MyExceptionEnum myExceptionEnum;

    private Throwable cause;

    public MyException(MyExceptionEnum myExceptionEnum, Throwable cause){
        this.myExceptionEnum = myExceptionEnum;
        this.cause = cause;
    }

    public MyExceptionEnum getMyExceptionEnum() {
        return myExceptionEnum;
    }

    public void setMyExceptionEnum(MyExceptionEnum myExceptionEnum) {
        this.myExceptionEnum = myExceptionEnum;
    }

    @Override
    public Throwable getCause() {
        return cause;
    }

    public void setCause(Throwable cause) {
        this.cause = cause;
    }

    @Override
    public String toString() {
        return "MyException{" +
                "myExceptionEnum=" + myExceptionEnum +
                ", cause=" + cause +
                '}';
    }
}
